<?php
	
	if(!@$_POST['akses'] == true) {
	   die('Akses langsung tidak diperbolehkan!');
	}
    
    include("dboper.php");
	
	//perjaprakan
	$sesi=mysql_real_escape_string($_POST['txtSesi']);
	$kelas=mysql_real_escape_string($_POST['txtNamaKelas']);
	$makul=mysql_real_escape_string($_POST['txtNamaMakul']);
	$hari=mysql_real_escape_string($_POST['txtHari']);
	
	$japrak=getIdJaprak($hari,$sesi,$makul,$kelas);
	
    $username = mysql_real_escape_string($_POST['txtUsername']);
    $password = mysql_real_escape_string($_POST['txtPassword']);
    $matakuliah = mysql_real_escape_string($_POST['txtNamaMakul']);
    $kelas = mysql_real_escape_string($_POST['txtKelas']);
    $pesan = mysql_real_escape_string($_POST['txtPesanSistem']);
    $pesanDepan = mysql_real_escape_string($_POST['txtPesanDepan']);
    $jenisPolling = $_POST['txtMetode'];
    $lihatPolling = $_POST['txtAkses'];    
    $cekIP = $_POST['txtIP'];
    $cekMAC = $_POST['txtMAC'];

    updateConfig($username, $password, $matakuliah, $kelas, $pesan, $pesanDepan, $jenisPolling, $lihatPolling,$cekIP,$cekMAC,$japrak);
    
?>
<script>
    alert('Data sukses diubah
    window.location.href = "./cp.php";
</script>